package com.ren.util;

import javax.servlet.http.Cookie;

/**
 * Created by Administrator on 2017/3/31.
 */
public final class CookieUtils {

    public static Cookie findCookie(Cookie[] cookies,String sessionName){

        if (cookies == null){
            return null;
        } else {

            for (Cookie cookie : cookies){
                if (cookie.getName().equals(sessionName))
                    return cookie;
            }

            return null;
        }

    }
}
